package com.example.rbac.controller.view;

import com.example.rbac.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by Administrator on 2017/10/16.
 */
@Controller
@RequestMapping("/Role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @RequestMapping("/listView")
    public String listView(){
        return "/Role/RoleList";
    }

    @RequestMapping("/addPermission/{id}")
    public String addPermission(@PathVariable(value = "id") String id, Model model){
        model.addAttribute("id", id);
        return "/Role/RoleAdd";
    }

    @GetMapping("/addRoleView")
    public String addRoleView(){
        return "/Role/role-add";
    }
}
